<script>
import {data} from "autoprefixer";

export default {
  mounted() {
    this.findAllUser()
  },
  methods: {
    del(row){
      this.$confirm('此操作将永久删除, 是否继续?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        this.$axios.get('AdminUser/delUser/',{
          params:{
            uid:row.userId
          }
        }).then(data=>{
          if (data.data.code==200){
            this.$message({
              type: 'success',
              message: '删除成功!'
            });
            // this.findAllUser()
          }
        })
      }).catch(() => {
        this.$message({
          type: 'info',
          message: '已取消删除'
        });
      });
    },
    findAllUser(){
      this.$axios.get('AdminUser/findAllUser',
      ).then(data=>{
        this.userlist=data.data.data
      })

    },


  },
  data() {
    return {
      userlist: [{
      }]
    }
  }
}

</script>

<template>
  <div><el-table
    :data="userlist"
    style="width: 100%"
    >
    <el-table-column
      prop="userName"
      label="昵称"
      width="180">
    </el-table-column>
    <el-table-column
      prop="userRelname"
      label="真实姓名"
      width="180">
    </el-table-column>
    <el-table-column
      prop="userTel"
      label="用户电话">
    </el-table-column>
    <el-table-column
      prop="userMail"
      label="用户邮箱">
    </el-table-column>
    <el-table-column
      prop="userVip"
      label="用户积分">
    </el-table-column>
    <el-table-column
      prop="userCare"
      label="用户身份证号码">
    </el-table-column>

    <el-table-column
      fixed="right"
      label="操作"
      width="100">
      <template slot-scope="scope">
        <el-button  @click="del(scope.row)" type="warning" >删除</el-button>
      </template>
    </el-table-column>
  </el-table>

  </div>

</template>

<style>
.el-table .warning-row {
  background: oldlace;
}

.el-table .success-row {
  background: #f0f9eb;
}

</style>
